import request from '@/config/axios'

// 团长缴费等级 VO
export interface TeamTypeVO {
  id: number // 主键
  name: string // 缴费名称
  price: number // 缴费价格
  originalPrice: number // 缴费原价
  icon: string // 类型图标
  equities: string // 会员权益
  commissionRate: number // 佣金比例0-100
  termType: number // 期限类型  1月 2季 3半年 4年
}

// 团长缴费等级 API
export const TeamTypeApi = {
  // 查询团长缴费等级分页
  getTeamTypePage: async (params: any) => {
    return await request.get({ url: `/wine/team-type/page`, params })
  },

  // 查询团长缴费等级详情
  getTeamType: async (id: number) => {
    return await request.get({ url: `/wine/team-type/get?id=` + id })
  },

  // 新增团长缴费等级
  createTeamType: async (data: TeamTypeVO) => {
    return await request.post({ url: `/wine/team-type/create`, data })
  },

  // 修改团长缴费等级
  updateTeamType: async (data: TeamTypeVO) => {
    return await request.put({ url: `/wine/team-type/update`, data })
  },

  // 删除团长缴费等级
  deleteTeamType: async (id: number) => {
    return await request.delete({ url: `/wine/team-type/delete?id=` + id })
  },

  // 导出团长缴费等级 Excel
  exportTeamType: async (params) => {
    return await request.download({ url: `/wine/team-type/export-excel`, params })
  }
}